package com.killers.cold.controlller.api;


import cold.model.param.LoginParams;
import com.killers.cold.model.Result;
import com.killers.cold.service.serviceImpl.SysUserService;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


@RestController
@Api(tags = "用户Api")
@RequestMapping("/api/")
public class UserAPIController {

    @Autowired
    SysUserService userService;

    @ResponseBody
    @PostMapping("login")
    public Result login(@RequestBody LoginParams loginParams) {

        // 用户登录
        Boolean login = userService.login(loginParams.getLoginName(), loginParams.getPassword());
        return Result.genSuccessResult(login);
    }

    @ResponseBody
    @GetMapping("test")
    public Result login() {
        return Result.genSuccessResult(1);
    }
}
